Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enabling building of GCC platform as a standalone shared library with no dependencies on e.g. Boost #2370

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

avtolstoy
Copy link
Member

@avtolstoy avtolstoy commented Oct 22, 2021

TODO

  1. Add a cmake file (potentially generated in runtime) which can simplify using this in libraries/applications
  2. Update CI to generate ready-to-use containers during release with Device OS prebuilt as a shared library

Problem

We want to simplify unit testing of libraries or applications that rely on Device OS APIs.

Solution

Build complete GCC platform for the host machine without any external dependencies on e.g. Boost, so that only stubs are generated, which can be easily mocked e.g. with Hippomocks.

NOTE: this requires GCC >= 6, as we need -fno-plt to enable mocking of symbols coming from shared library.

Steps to Test

See https://github.com/particle-iot-inc/device-os-unit-test-demo

Example App

N/A

References

N/A


Completeness

  • User is totes amazing for contributing!
  • Contributor has signed CLA (Info here)
  • Problem and Solution clearly stated
  • Run unit/integration/application tests on device
  • Added documentation
  • Added to CHANGELOG.md after merging (add links to docs and issues)

@avtolstoy avtolstoy force-pushed the feature/device-os-standalone-lib branch from 81d8173 to 4682040 Compare November 5, 2021 23:44
@eberseth
Copy link
Contributor

The "steps to test" repo is not public. Can you provide snippets here?

@eberseth eberseth closed this Jan 14, 2022
@eberseth eberseth reopened this Jan 14, 2022
@avtolstoy
Copy link
Member Author

@eberseth It's in a different org, you should have permissions for it though?

@technobly technobly changed the title Enabling building of GCC platform as a standalon shared library with no dependencies on e.g. Boost Enabling building of GCC platform as a standalone shared library with no dependencies on e.g. Boost Sep 8, 2022
@eberseth
Copy link
Contributor

@avtolstoy Could we merge this for 6.x? There is some future work that would benefit from not having Boost dependencies.

@eberseth eberseth added 6.x and removed 4.x 5.x labels May 29, 2024
@avtolstoy
Copy link
Member Author

@eberseth This is only useful for unit testing/mocking.

Build complete GCC platform for the host machine without any external dependencies on e.g. Boost, so that only stubs are generated, which can be easily mocked e.g. with Hippomocks.

GCC platform to work does require Boost, this will simply replace proper implementations with empty stubs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants